﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Index.aspx.cs" Inherits="UI_Mail_Index" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
  <head runat="server">
    <title></title>
    <link href="../../css/admin.css" rel="stylesheet" type="text/css" />
    <link href="../../js/jquery.easyui/themes/default/easyui.css" rel="stylesheet" type="text/css" />
    <link href="../../js/jquery.easyui/themes/icon.css" rel="stylesheet" type="text/css" />
    <script src="../../js/jquery.easyui/jquery.min.js" type="text/javascript"></script>
    <script src="../../js/jquery.easyui/jquery.easyui.min.js" type="text/javascript"></script>
    <script src="../../js/js.js" type="text/javascript"></script>
    <script type="text/javascript">
      $(document).ready(function () {
       var eBayUserID = request.QueryString('ebayuserid');
       eBayUserID='bobob_uk';
       var refreshIndex = function() {
         $.getJSON(
           './MailHandler.ashx?act=q&id=0001&ebayuserid=' + eBayUserID,
           function(data) {
             if (data.retVal == 0) {
               if(data.retSrc && data.retSrc.MailIndex && data.retSrc.MailIndex.length > 0) {
                 var mailIndex = data.retSrc.MailIndex[0];
                 $('#span-4352').text(mailIndex.ManuallySelector > 0 ? ' ('+mailIndex.ManuallySelector+')' : '');
                 $('#span-4608').text(mailIndex.Auto > 0 ? ' ('+mailIndex.Auto+')' : '');
                 $('#span-4625').text(mailIndex.FromeBay > 0 ? ' ('+mailIndex.FromeBay+')' : '');
                 $('#span-4640').text(mailIndex.FromMember > 0 ? ' ('+mailIndex.FromMember+')' : '');
                 if (mailIndex.BeforSale) {
                   $('#presale').text(' ('+mailIndex.BeforeSale+')');
                 }
                 if (mailIndex.DT) {
                   $('#dt').text(' ('+mailIndex.DT+')');
                 }
                 if (mailIndex.IAD) {
                   $('#iad').text(' ('+mailIndex.IAD+')');
                 }
                 if (mailIndex.PP) {
                   $('#pp').text(' ('+mailIndex.PP+')');
                 }
                 if (mailIndex.COM) {
                   $('#com').text(' ('+mailIndex.COM+')');
                 }
                 if (mailIndex.Other) {
                   $('#other').text(' ('+mailIndex.Other+')');
                 }
               }
             }
           });
       };


       $('#btnrefresh').click(function() {
         refreshIndex();
       });

       refreshIndex();
       
       $('#left').tree({
         onClick: function(node) {
           $('#divContent').html('<iframe src="'+'./Message.aspx?ebayuserid='+eBayUserID+'&folderid='+node.attributes.folderid+'" width="100%" height="100%" frameborder="0" scrolling="auto" ></iframe>');           
         }
       });
       var loadPage = function (url) {
         $('#divContent').html('<iframe src="' + 'Message.aspx' + '" width="100%" height="100%" frameborder="0" scrolling="auto" ></iframe>');
       };
     });
     
     var request = {
       QueryString: function (val) {
         var url = window.location.search;
         var re = new RegExp('' + val + '=([^&?]*)', 'ig');
         return ((url.match(re)) ? (url.match(re)[0].substr(val.length + 1)) : null);
       }
     };
    </script>
  </head>
  <body class="easyui-layout">
    <div data-options="region:'west',split:true,title:'菜单栏'" style="width:220px;padding:10px;">
      <div class="Menu"><img src="11111" class="MemuImg" />134134</div>
      <div class="MenuNote" style="display:none;">
        <img src="../../images/menu_topline.gif" alt="" />
        <div class="CMenu">1234</div>
        <div class="CMenuNote" style="display:none;">
      <a id="btnrefresh" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true" style="float:right;"></a>
        <ul id="left" class="easyui-tree">
          <li id="folder-4096'" data-options="attributes: {'folderid':'4096'}">
          <span>未处理<span id="span-4096"></span></span>
          <ul>
            <li id="folder-4352" data-options="attributes: {'folderid':'4352'}"><span>Manually Selector<span id="span-4352"></span></span></li>
            <li id="folder-4608" data-options="attributes: {'folderid':'4608'}">
              <span>Auto<span id="span-4608"></span></span>
              <ul>
                <li id="folder-4624" data-options="attributes: {'folderid':'4624'}"><span>From eBay<span  id="span-4624"></span></span></li>
                <li id="folder-4640" data-options="attributes: {'folderid':'4640'}">
                  <span>From Member<span id="span-4640"></span></span>
                  <ul>
                    <li id="folder-4641" data-options="attributes: {'folderid':'4641'}"><span>售前<span id="span-4641"></span></span></li>
                    <li id="folder-4642" data-options="attributes: {'folderid':'4642'}"><span>DT<span id="span-4642"></span></span></li>
                    <li id="folder-4643" data-options="attributes: {'folderid':'4643'}"><span>IAD<span id="span-4643"></span></span></li>
                    <li id="folder-4644" data-options="attributes: {'folderid':'4644'}"><span>P&P<span id="span-4644"></span></span></li>
                    <li id="folder-4645" data-options="attributes: {'folderid':'4645'}"><span>COM<span id="span-4645"></span></span></li>
                    <li id="folder-4646" data-options="attributes: {'folderid':'4646'}"><span>Other<span id="span-4646"></span></span></li>
                  </ul>
                </li>
                <li id="folder-4656" data-options="attributes: {'folderid':'4656'}">
                  <span>High Priority<span id="span-4656"></span></span>
                  <ul>
                    <li id="folder-4657" data-options="attributes: {'folderid':'4657'}"><span>Account Threat<span id="span-4657"></span></span></li>
                    <li id="folder-4658" data-options="attributes: {'folderid':'4658'}"><span>From Manager<span id="span-4658"></span></span></li>
                    <li id="folder-4659" data-options="attributes: {'folderid':'4659'}"><span>eBay Support<span id="span-4659"></span></span></li>
                  </ul>
                </li>
              </ul>
            </li>
          </ul>
        </li>
        <li id="folder-8192" data-options="attributes: {'folderid':'8192'}">
          <span>Send<span id="span-8192"></span></span>
          <ul>
            <li id="folder-8448" data-options="attributes: {'folderid':'8448'}"><span>草稿箱<span id="span-8448"></span></span></li>
            <li id="folder-8740" data-options="attributes: {'folderid':'8704'}"><span>等待发送<span id="span-8740"></span></span></li>
            <li id="folder-8960" data-options="attributes: {'folderid':'8960'}"><span>发送失败<span id="span-8960"></span></span></li>
            <li id="folder-9216" data-options="attributes: {'folderid':'9216'}"><span>已发送<span id="span-9216"></span></span></li>
          </ul>
        </li>
        <li id="folder-12288" data-options="attributes: {'folderid':'12888'}">
          <span>旗帜<span id="span-12288"></span></span>
          <ul>
            <li id="folder-12544" data-options="attributes: {'folderid':'12544'}"><img src="../../Images/1.gif" width="20" height="20" />紧急</li>
            <li id="folder-12800" data-options="attributes: {'folderid':'12800'}"><img src="../../Images/1.gif" width="20" height="20" />等待回复</li>
          </ul>
        </li>
        <li data-options="iconCls:'icon-add'">
          <span>已处理</span>
          <ul>
            <li>
              <span>Auto<span id="doneauto"></span></span>
              <ul>
                <li><span>From eBay<span  id="donefromebay"></span></span></li>
                <li>
                  <span>From Member<span id="donefrommember"></span></span>
                  <ul>
                    <li><span>售前<span id="donepresale"></span></span></li>
                    <li><span>DT<span id="donedt"></span></span></li>
                    <li><span>IAD<span id="doneiad"></span></span></li>
                    <li><span>P&P<span id="donepp"></span></span></li>
                    <li><span>COM<span id="donecom"></span></span></li>
                    <li><span>Other<span id="doneother"></span></span></li>
                  </ul>
                </li>
              </ul>
            </li>
          </ul>
        </li>
        <li><span>黑名单</span></li>
      </ul>
    </div>
        </div>
      </div>

	  <div id="divContent" data-options="region:'center'">
	  </div>
  </body>
</html>
